package world.ztomorrow.common.config;

import org.springframework.amqp.support.converter.Jackson2JsonMessageConverter;
import org.springframework.amqp.support.converter.MessageConverter;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
@ConditionalOnClass(Jackson2JsonMessageConverter.class)
public class MQConfig {

    @Bean
    public MessageConverter messageConverter() {
        Jackson2JsonMessageConverter jjm = new Jackson2JsonMessageConverter();
        jjm.setCreateMessageIds(true);
        return jjm;
    }
}
